#ifndef MODEL_CONF_H
#define MODEL_CONF_H

#include <iostream>
#include <string>
#include <fstream>
#include <map>
#include <stdlib.h>
#include <pwd.h>
#include <unistd.h>

namespace Model {

#define MODEL_CONF_PATH "/opt/lgb-gp-sna/"

  class ModelConf
  {
    std::map<std::string,double> doubleData;
    std::map<std::string,std::string> stringData;

    static ModelConf *instance;
    
    bool ReadConfFileItem(std::ifstream &in,std::string path);
    bool ReadConfFile();
    ModelConf();

  public:
    static ModelConf *GetModelConf();

    ~ModelConf();

    double GetDoubleData(const std::string &name);
    std::string GetStringData(const std::string &name);

    //for testing ....
    void ShowAllData(){
      std::map<std::string, double>::iterator it;
      for ( it=doubleData.begin() ; it != doubleData.end(); it++ )
	std::cout<<"[ "<<(*it).first<<" ] = "<<(*it).second<<"\n";

      std::map<std::string, std::string>::iterator it2;
      for ( it2=stringData.begin() ; it2 != stringData.end(); it2++ )
	std::cout<<"[ "<<(*it2).first<<" ] = "<<(*it2).second<<"\n";
    }

  };

}

#endif
